<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1-100的和
        var sum = 0;
        for (var i = 1; i <= 100; i++) {
            sum += i;
        }
        console.log(sum);
        //1-100偶数和
        var sum1 = 0;
        for (var i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                sum1 += i;
            }
        }
        console.log(sum1);
        //1-100能被7整除的和
        var sum2 = 0;
        for (var i = 1; i <= 100; i++) {
            if (i % 7 == 0) {
                sum2 += i;
            }
        }
        console.log(sum2);
        //打印矩形⭐
        var a = '';
        for (var i = 1; i <= 5; i++) {
            for (var j = 1; j <= 10; j++) {
                a += '⭐';
            }
            a += '\n';
        }
        console.log(a);
        //打印三角形
        var str = '';
        for (var i = 1; i <= 10; i++) {
            for (var j = 1; j <= i; j++) {
                str += '⭐';
            }
            str += '\n';
        }
        console.log(str);
    </script>
</body>

</html>